package cn.xfdzx.android.apps.shop.contract;

import java.util.Map;

import cn.xfdzx.android.apps.shop.base.BaseView;
import cn.xfdzx.android.apps.shop.bean.GoodsLiblaryListBean;
import cn.xfdzx.android.apps.shop.bean.GoodsUpStateBeen;
import cn.xfdzx.android.apps.shop.bean.NewOrderBeen;
import cn.xfdzx.android.apps.shop.bean.OneCategoryBeen;
import cn.xfdzx.android.apps.shop.bean.OrderListBeen;
import cn.xfdzx.android.apps.shop.bean.ShopAddGoodTypeBeen;
import cn.xfdzx.android.apps.shop.bean.ShopInGoodListBeen;
import cn.xfdzx.android.apps.shop.bean.UpdateNumPriceBeen;
import io.reactivex.Flowable;


/**
 * @author azheng
 * @date 2018/6/4.
 * Description：
 */

public interface ShopInGoodListContract {
    interface Model {
        Flowable<ShopInGoodListBeen> initData(Map<String,Object> map);
        Flowable<GoodsUpStateBeen> goodsUpState(String id, String state);

        Flowable<UpdateNumPriceBeen> updateNumPrice(String id, String marketprice, String stock, String discountprice);
        Flowable<GoodsLiblaryListBean> getLibraryList(Map<String,Object> map);

        Flowable<OneCategoryBeen> getOneCategory(Map<String,Object> map);

        Flowable<OneCategoryBeen> addGoods(Map<String,Object> map);

        Flowable<ShopAddGoodTypeBeen> getCategory_list();

    }

    interface View extends BaseView {
        @Override
        void showLoading();

        @Override
        void hideLoading();

        @Override
        void onError(Throwable throwable);

        void onGoodListSuccess(ShopInGoodListBeen bean);

        /**
         * 刷新完成
         */
        void finishRefresh();

        /**
         * 加载完成
         */
        void finishLoadMore();

        void onGoodsUpStateSuccess(GoodsUpStateBeen bean, int position);

        void onUpdateNumPriceSuccess(UpdateNumPriceBeen bean);

        void getLibraryListSuccess(GoodsLiblaryListBean bean);

        void getOneCategorySuccess(OneCategoryBeen bean);

        void addGoodsSuccess(OneCategoryBeen bean,String catoryId);

        void getCategoryListSuccess(ShopAddGoodTypeBeen bean);
    }

    interface Presenter {
        /**
         * 请求各个状态 的订单列表
         */
        void initData(boolean isRefresh, boolean isLoading, Map<String,Object> map);

        /**
         *
         */
        void goodsUpState(String id, String state,  int position);

        void updateNumPrice( String id, String marketprice, String stock, String discountprice);

        void getLibraryList(boolean isRefresh, boolean isLoading,Map<String,Object> map);

        void getOneCategory(Map<String,Object> map);

        void addGoods(Map<String,Object> map,String catoryId);

        void getCategoryList();

    }
}
